package cn.wjzhang.middle.modules.global.beans.request.weather;

import cn.hutool.http.Method;
import cn.wjzhang.middle.modules.global.beans.request.SeniverseRequest;
import cn.wjzhang.middle.modules.global.beans.response.weather.WeatherResponse;
import com.alibaba.csp.sentinel.cluster.annotation.RequestType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;

/**
 * ========================
 * 功能描述
 *
 * @author wjzhang
 * @version v1.0
 * ========================
 * @date 2023/7/3 12:29
 */
@Setter
@Getter
@ToString
@ApiModel(value = "WeatherRequest", description = "详情查看:https://seniverse.yuque.com/hyper_data/api_v3/bwi8100zvwl0koau#ElVVu")
public class WeatherRequest  extends SeniverseRequest<WeatherResponse> {


    @ApiModelProperty(value = "地点:" +
            "WX4FBXXFKE4F  城市 ID（可以通过城市查询接口获取）\n" +
            "北京  城市中文名\n" +
            "江苏南京  省市名称组合\n" +
            "江苏鼓楼  省+区县名称组合（目前v3接口暂不支持城市+区县的查询如南京鼓楼）\n" +
            "beijing  城市拼音/英文名（如拼音相同城市，可在之前加省份和空格，例：shanxi yulin）\n" +
            "39.93:116.40  经纬度（格式是 纬度:经度，英文冒号分隔）\n" +
            "220.181.111.86  IP 地址（某些 IP 地址可能无法定位到城市）\n" +
            "ip  “ip”两个字母 自动识别请求 IP 地址")
    @NotNull(message = "地点不能为空")
    private String location;

    @ApiModelProperty(value = "语言:默认zh-Hans 简体中文")
    private String language;

    @ApiModelProperty(value = "单位: 默认c")
    private String unit;

    @ApiModelProperty(value = "起始时间: 默认值为0;-1 昨天 0 今天")
    private String start;

    @ApiModelProperty(value = "天:默认 3")
    private String days;


    @Override
    public void build() {
        super.setUrl("/v3/weather/daily.json");
        super.setRequestType(Method.GET);
    }
}
